package com.station.administrators.controller;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.github.pagehelper.PageInfo;
import com.open.capacity.common.model.FinanceModel;
import com.open.capacity.common.web.Result;
import com.station.administrators.service.FinanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * @author YangGang
 * @Title: 财务状况
 * @Description: TODO
 * @date 2021/6/30/15:07
 */
@RestController
@RequestMapping("/finance")
public class FinanceController {
    @Autowired
    private FinanceService financeService;

    @GetMapping("/detailed")
    public Object detailed(FinanceModel financeModel){
        PageInfo<FinanceModel> financeModelList=financeService.detailed(financeModel);
        return Result.succeed(financeModelList,"查询成功！");
    }
    @GetMapping("/monthlyReport")
    public Object monthlyReport(FinanceModel financeModel){
        List<FinanceModel> financeModelList =financeService.monthlyReport(financeModel);
        return Result.succeed(financeModelList,"查询成功！");
    }
    @Transactional
    @GetMapping("/annualReport")
    public Object annualReport(FinanceModel financeModel){
        List<FinanceModel> financeModelList =financeService.annualReport(financeModel);
        return Result.succeed(financeModelList,"查询成功！");
    }
    @GetMapping("/annualFindAll")
    public Object annualFindAll(FinanceModel financeModel){
        PageInfo<FinanceModel> financeModelList =financeService.annualFindAll(financeModel);
        return Result.succeed(financeModelList,"查询成功！");
    }
    @GetMapping("/monthlyFindAll")
    public Object monthlyFindAll(FinanceModel financeModel){
        PageInfo<FinanceModel> financeModelList =financeService.monthlyFindAll(financeModel);
        return Result.succeed(financeModelList,"查询成功！");
    }


}
